Clap Definition Language (CDL) is an XML-based markup language which is used to create car diagnostic session. It contains all information for connecting to one or more ECUs in given vehicle, and for correct interpretation of provided data. CDL consists of a DTDs (DTD=Document Type Definition) which define the document structure using list of legal elements and attributes.

Tags used in CDL, and their meaning:

<CarDiagnostic>	
	- this is the root tag. The diagnostic file must contain a <CarDiagnostic> XML tag that surrounds one or more following tags.

<Adapter>
	- this tag describes used adapter. Current implementation (v.1.0) supports exactly one adapter.

<Vehicle>
	- this tag describes the car which is being 

<DiagnosticList>
	- this tag is a holder for list of separate diagnostic sessions, see also below tag <Diagnostic>. From Clap application point of view this tag corresponds to the application's main pivot UI element.

<Diagnostic>
	- this tag describes single diagnostic session against specific ECU. From Clap application point of view it presents one page (pivot item) with the list of diagnostic data. This tag should contain exactly one <ECU> tag, and one <ParamList> tag.

<Ecu>
	- this tag describes ECU and the way to connect it through ELm327 adapter.

<ParamList>
	- this tag is a holder for <Param> tags.

<Param>
	- this tag presents elementary diagnostic information item, like speed, or VIN, or engine oil temperature. 

<CarDiagnostic>
<!ELEMENT CarDiagnostic (Adapter,Vehicle,DiagnosticList)>
<!ATTLIST CarDiagnostic 
	Version CDATA #IMPLIED
	Language CDATA #IMPLIED
	Comment CDATA #IMPLIED
	Image CDATA #IMPLIED>

<Adapter>
<!ELEMENT Adapter EMPTY>
<!ATTLIST Adapter
	Name CDATA #REQUIRED
	Type CDATA #REQUIRED>

<Vehicle>
<!ELEMENT Vehicle EMPTY>
<!ATTLIST Vehicle
	ModelName CDATA #IMPLIED
	Identification CDATA #IMPLIED
	Vin CDATA	#IMPLIED>

<DiagnosticList>
<!ELEMENT DiagnosticList (Diagnostic+)>

<Diagnostic>
<!ELEMENT Diagnostic (Ecu,ParamList)>
<!ATTLIST Diagnostic
	Title CDATA #REQUIRED
	Style (List|BigList|RoundedBigList|Tile|RoundedTile) #REQUIRED
	ColorSchema (BlackAndWhite|BlueAndYellow|
				GreenAndYellow|BrownAndBisque|BlueEspace) #IMPLIED>

<Ecu>
<!ELEMENT Ecu EMPTY>
<!ATTLIST Ecu
	Name	CDATA #IMPLIED
	Protocol (KWP|CAN250|CAN500) #REQUIRED
	Request CDATA #REQUIRED
	Reply CDATA #REQUIRED
	WakeUp CDATA #IMPLIED
	Session CDATA #IMPLIED
	OpenSequence CDATA #IMPLIED
	Comment CDATA #IMPLIED>

<ParamList>
<!ELEMENT ParamList (Param+)>

<Param>
<!ELEMENT Param EMPTY>
<!ATTLIST Param
	Name CDATA #REQUIRED
	Code CDATA #REQUIRED
	RepLen CDATA #IMPLIED
	FirstByte CDATA #REQUIRED
	Len CDATA	#REQUIRED
	Step CDATA #IMPLIED
	Offset CDATA #IMPLIED
	DivideBy CDATA #IMPLIED
	BitMask CDATA #IMPLIED
	RollToRight CDATA #IMPLIED
	GetA CDATA #IMPLIED
	SetA CDATA #IMPLIED
	Enumeration CDATA #IMPLIED
	Format CDATA #REQUIRED>

Note: the order of parameters Offset and DivideBy  is considered during the calculation. The incorrect order may lead to the wrong result.

Last updated: 03/24/2015